use Test::Simple tests => 2;

use SI::Person;

sub make_new_person {
    my $new_base_hr = shift;
    my $p = SI::Person->new;
    $p->new_base($new_base_hr);
    
}

sub update_person {
    my $sn = shift;
    my $base_update = shift;
    my $p = SI::Person->new(sn=>$sn);
    $p->set_base($base_update);
    
}

my $base_new = {
    sn => '00000067890123',
    id => '412932190001023538',
    name => '许仙',
    sex => '男',
    nation_code => '01',
    company_id => 'A_01',
    tel => undef,
    postcode => undef,
    status_code => '01',
};

ok(make_new_person($base_new)->sn eq $base_new->{sn}, 'new_base() is ok!');
ok(update_person($base_new->{sn}, {name => '星爵'}), 'update_base() is ok!');

SI::Person->new(sn=>'00000067890123')->del_base;